From: Richard M. Stallman Date: Mon, 20 Jan 2003 09:00:48 +0000 (+0000) Subject: (regexp-opt-group): Compute HALF2 properly. X-Git-Tag: archive/raspbian/1%29.2+1-2+rpi1~1^2~28719 X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/cgi/%22https:/www.github.com/%22bookmarks:///%22http:/www.example.com/cgi/%22https:/www.github.com/%22bookmarks:/?a=commitdiff_plain;h=60cb4ef7237cf23ccfeee5061d8901cdf3bc1721;p=emacs.git (regexp-opt-group): Compute HALF2 properly. --- diff --git a/lisp/emacs-lisp/regexp-opt.el b/lisp/emacs-lisp/regexp-opt.el index b746c8a22f3..ea80801b610 100644 --- a/lisp/emacs-lisp/regexp-opt.el +++ b/lisp/emacs-lisp/regexp-opt.el @@ -223,7 +223,10 @@ so we can use character sets rather than grouping parenthesis." ;; particular letter and those that do not, and recurse on them. (let* ((char (char-to-string (string-to-char (car strings)))) (half1 (all-completions char strings)) - (half2 (nthcdr (length half1) strings))) + (half2 strings)) + ;; Remove from HALF2 whatever is in HALF1. + (dolist (elt half1) + (setq half2 (delq elt half2))) (concat open-group (regexp-opt-group half1) "\\|" (regexp-opt-group half2)